import {Directive, EventEmitter, HostListener, Output} from '@angular/core';

@Directive({
  selector: '[ngToolsMouseDownUp]'
})
export class MouseDownUpDirective {
  @Output()
  private mouseDown = new EventEmitter();
  @Output()
  private mouseUp = new EventEmitter();

  @HostListener('mousedown')
  down() {
    this.mouseDown.emit();
  }

  @HostListener('mouseup')
  @HostListener('mouseleave')
  up() {
    this.mouseUp.emit();
  }

  constructor() {
  }

}
